#include "OmniLightParser.h"

OmniLightParser::OmniLightParser(void)
{
}

OmniLightParser::~OmniLightParser(void)
{
}

OmniLightParser::OmniLightParser(string id, int light_id, int enabled):LightParser(id, light_id,enabled)
{
}

void OmniLightParser::setLight(){
	glLightfv(light_i, GL_AMBIENT, ambient);
	glLightfv(light_i, GL_DIFFUSE, diffuse);
	glLightfv(light_i, GL_SPECULAR, specular);

	glLightf(light_i, GL_CONSTANT_ATTENUATION, 0);
	glLightf(light_i, GL_LINEAR_ATTENUATION,1);
	glLightf(light_i, GL_QUADRATIC_ATTENUATION, 0);

	if(enabled)
		glEnable(light_i);
}

void OmniLightParser::setLightPos(){
	glLightfv(light_i, GL_POSITION,location);
}